<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-login-add">

			 <div class="form-group">	
                <label class="col-sm-4 control-label">用户代码：</label>
                <div class="col-sm-3">
                    <input id="userId" name="userId" class="form-control" type="text"  placeholder="请输入用户代码" >
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-4 control-label">密码：</label>
                <div class="col-sm-3">
                    <input id="password" name="password" class="form-control" type="password"  placeholder="请输入密码">
                </div>
            </div>

			<div class="form-group">
				<div class="form-control-static col-sm-offset-7">
					<button type="submit" id="submit" onclick="ajaxSubmit()"  class="btn btn-primary">登录</button>
					 <a  style="display:none"  href="/system/template/"   class="btn btn-primary" id="aTemplate" rel="external nofollow" >
					    <span id="spanId">下一步</span>
					 </a>
				</div>
			</div>
			
			
		</form>
	</div>
    <div th:include="include::footer"></div>
 <script type="text/javascript" th:inline="javascript">

        /*<![CDATA[*/
            function ajaxSubmit(){
                var password = $("#password").val();
                var userId = $("#userId").val();

                $.ajax({
                    url: [[@{/system/login/login}]],
                    type: "post",
                    timeout : 10000, //超时时间设置，单位毫秒
                    contentType: 'application/json',
                    data: JSON.stringify({userId : userId,password : password}),
   

                    async: true,
                    success: function(reult){
                   	    $("#spanId").click();

                    	//window.location.href = ctx + "/system/template/template";
                    	　//location.href= /*[[@{/system/template}]]*/;
                    	 // document.getElementById("spanId").click();
                    	 
                    }
                });
            }

        /*]]>*/

    </script>

</body>
</html>

